Skip to content

[3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0#153484

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-tk9-tests-3.13
Jul 11, 2026
Merged

[3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0#153484
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-tk9-tests-3.13

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Backport the test-only parts of the Tcl/Tk 8.7/9.0/9.1 test adaptations so that test_tkinter and test_ttk pass when Python 3.13 is built against Tcl/Tk 9.0 or 9.1 (for example the Homebrew build used on macOS — see gh-128846), while still passing against the Tcl/Tk 8.6 that 3.13 ships.

These adaptations were made during 3.14/3.15 development and never backported to 3.13, so building 3.13 against Tk 9.0 currently produces ~90 spurious test_tkinter failures and several test_ttk failures (error-message wording such as doesn'tdoes not and can'tcannot find busy window, pixel rounding/scaling, clipped negative sizes, identify() returning padding instead of focus, etc.).

This combines the test changes from:

The corresponding non-test changes (Modules/_tkinter.c, Lib/tkinter/ttk.py, PCbuild and CI configuration) are not backported. The \z regular-expression escape introduced by gh-133306 is not available in the 3.13 re module, so \Z is kept.

The NotebookTest.test_traversal hardening is handled separately by GH-153415 (already merged) and is not part of this PR.

Verified locally against Tcl/Tk 8.6, 9.0.4 and 9.1b1 (the affected test_tkinter and test_ttk methods pass on all three); the set of collected test cases is unchanged, so no test coverage is dropped.

Backport the test-only parts of the Tcl/Tk 8.7/9.0/9.1 test adaptations so
that test_tkinter and test_ttk pass when Python 3.13 is built against
Tcl/Tk 9.0 (for example the Homebrew build used on macOS), while still
passing against the Tcl/Tk 8.6 that 3.13 ships.

Combines the test changes from:

* pythongh-124111: Update tkinter for compatibility with Tcl/Tk 9.0.0 (pythonGH-124156)
* pythongh-124111: test macOS CI with Tk 9 (pythonGH-137424)
* pythongh-145736: Fix Tkinter tests for Tk 8.7, 9.0 and 9.1 (pythonGH-145738)

The corresponding non-test changes (Modules/_tkinter.c, Lib/tkinter/ttk.py,
PCbuild and CI configuration) are not backported.  The \z regular-expression
escape introduced by pythongh-133306 is not available in the 3.13 re module, so
\Z is kept.
@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir skip news labels Jul 10, 2026
@serhiy-storchaka serhiy-storchaka merged commit 59e183c into python:3.13 Jul 11, 2026
42 checks passed
@serhiy-storchaka serhiy-storchaka deleted the backport-tk9-tests-3.13 branch July 11, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant